Recent electronic devices such as portable terminals may detect movement of the electronic device, an approach state of an object to the electronic device, or a contact state of an object with the electronic device, using various sensor modules. In addition, the electronic device may identify whether various functions such as communication, multimedia, and gaming are being executed.